package cn.edu.cqupt.cyExam.myBatis.dao;

import java.util.List;

import cn.edu.cqupt.cyExam.myBatis.bean.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;



import org.springframework.stereotype.Repository;


@Repository
public interface UserMapper {

    List<User> queryUserList();
    User userLogin(String user_name,String user_password);
    User queryUserById(int id);
    int addUser(User user);
    int updateUser(User user);
    int deletUser(String user_name);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table user
     *
     * @mbggenerated Sat Mar 13 21:03:08 CST 2021
     */
    int deleteByPrimaryKey(Integer userId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table user
     *
     * @mbggenerated Sat Mar 13 21:03:08 CST 2021
     */
    int insert(User record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table user
     *
     * @mbggenerated Sat Mar 13 21:03:08 CST 2021
     */
    int insertSelective(User record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table user
     *
     * @mbggenerated Sat Mar 13 21:03:08 CST 2021
     */
    User selectByPrimaryKey(Integer userId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table user
     *
     * @mbggenerated Sat Mar 13 21:03:08 CST 2021
     */
    int updateByPrimaryKeySelective(User record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table user
     *
     * @mbggenerated Sat Mar 13 21:03:08 CST 2021
     */

    int updateByPrimaryKey(User record);
    //查看全部用户
    List<User> selectall();
    //检查账户的唯一性
    int CheckAcount(String usersAccountnumber);
    //检查邮箱的唯一性
	int CheckEmail(String usersEmail);


    //注册用户
    int insertUsers(User user);

    User selectUsersByUsersAccountnumber(String user_name);

  //通过邮件随机密码
  	int updatepasswordByeMail(@Param("MailPasswordByMD5")String MailPasswordByMD5,@Param("account")String account);

  //修改密码
  	int updatePassWord(@Param("userid")Integer userid,@Param("PasswordByMD5")String PasswordByMD5);

  //通过getUserByusersAccountnumber
  	User getUserByusersAccountnumber(String usersAccountnumber);

  	 int getUserIdBycount(String usersAccountnumber);
    }


